﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Business;

namespace University.Workshop.Presenters.FeesAndFines.Search
{
    public class PresenterSearchFees
    {
        ISearchFeesView view;

        public PresenterSearchFees(ISearchFeesView view)
        {
            this.view = view;
        }

        public void SearchInFees()
        {
            try
            {
                Model.FeesAndFines feesRelative = new Model.FeesAndFines() { EffectiveDate = view.effectiveDate, Charge = view.charge, NonPayment = view.nonPayment };
                view.feesFinded = ManagerFeesAndFines.SearchFeesByParameter(feesRelative);
            }
            catch(Exception ex)
            {
                view.feesFinded = null;
                view.NotifyErrorMessage(ex.Message);
            }
        }

    }
}
